import request from '@/utils/request';
// request.defaults.baseURL = 'https://console-mock.apipost.cn/app/mock/project/79ea3b05-05f2-4f42-b40d-3d7f56281f27'

/**
 * 达人列表
 * @param data
 * @returns
 */
export const getWiseManList = (data: any, flag = false) => {
    return request({
        url: '/scrm-api/console/retail/daren/list',
        method: 'POST',
        data,
        noNeedLoading: flag
    });
};

/**
 * 获取可添加达人数
 * @param data
 * @returns
 */
export const getWiseManRestCount = (data: any, flag = false) => {
    return request({
        url: '/scrm-api/console/retail/daren/get-daren-num',
        method: 'POST',
        data,
        noNeedLoading: flag
    });
};

/**
 * 删除达人
 * @param data
 * @returns
 */
export const deleteWiseMan = (data: any, flag = false) => {
    return request({
        url: '/scrm-api/console/retail/daren/delete',
        method: 'POST',
        data,
        noNeedLoading: flag
    });
};

/**
 * 添加达人
 * @param data
 * @returns
 */
export const createWiseMan = (data: any, flag = false) => {
    return request({
        url: '/scrm-api/console/retail/daren/create',
        method: 'POST',
        data,
        noNeedLoading: flag,
        type: 1
    });
};
/**
 * 达人授权
 * @param data
 * @returns
 */
export const authWiseMan = (data: any, flag = false) => {
    return request({
        url: '/scrm-api/console/retail/daren/auth',
        method: 'POST',
        data,
        noNeedLoading: flag
    });
};
/**
 * 快手达人授权
 * @param data
 * @returns
 */
export const authKuaishouWiseMan = (data: any, flag = false) => {
    return request({
        url: '/scrm-api/console/retail/daren/auth/qrcode',
        method: 'POST',
        data,
        noNeedLoading: flag
    });
};
/**
 * 获取过期提醒设置
 * @param data
 * @returns
 */
export const getRemindSetting = (data: any, flag = false) => {
    return request({
        url: '/scrm-api/console/retail/daren/get-remind',
        method: 'POST',
        data,
        noNeedLoading: flag
    });
};

/**
 * 设置过期提醒设置
 * @param data
 * @returns
 */
export const setRemindSetting = (data: any, flag = false) => {
    return request({
        url: '/scrm-api/console/retail/daren/set-remind',
        method: 'POST',
        data,
        noNeedLoading: flag
    });
};

/**
 * 授权回调
 * @param data
 * @returns
 */
export const getCreateWiseManResult = (data: any, flag = false) => {
    return request({
        url: '/scrm-api/console/retail/daren/auth-callback',
        method: 'POST',
        data,
        noNeedLoading: flag
    });
};

/**
 * 同步达人订单
 * @param data
 * @returns
 */
export const syncDarenOrder = (data: any, flag = false) => {
    return request({
        url: '/scrm-api/console/retail/daren/order-sync',
        method: 'POST',
        data,
        noNeedLoading: flag
    });
};

/**
 * 达人订单列表
 * @param data
 * @returns
 */
export const getDarenOrderList = (data: any, flag = false) => {
    return request({
        url: '/scrm-api/console/retail/daren/order',
        method: 'POST',
        data,
        noNeedLoading: flag
    });
};

/**
 * 支付金额占比
 * @param data
 * @returns
 */
export const payRatioDetail = (data: any, flag = false) => {
    return request({
        url: '/scrm-api/console/retail/daren/pay-percent',
        method: 'POST',
        data,
        noNeedLoading: flag
    });
};

/**
 * 达人销售统计
 * @param data
 * @returns
 */
export const trendChartsDetail = (data: any, flag = false) => {
    return request({
        url: '/scrm-api/console/retail/daren/trend',
        method: 'POST',
        data,
        noNeedLoading: flag
    });
};

/**
 * 达人销售数据总览
 * @param data
 * @returns
 */
export const trendoverviewDetail = (data: any, flag = false) => {
    return request({
        url: '/scrm-api/console/retail/daren/data-overview',
        method: 'POST',
        data,
        noNeedLoading: flag
    });
};

/**
 * 达人销售数据下载
 * @param data
 * @returns
 */
export const trendChartsDetailExport = (data: any, flag = false) => {
    return request({
        url: '/scrm-api/console/retail/daren/trend-export',
        method: 'POST',
        data,
        noNeedLoading: flag
    });
};
